package org.dandsoft.blackbox.evolution;

import org.dandsoft.blackbox.SignalId;
import org.dandsoft.blackbox.evolution.triggers.Trigger;

import java.util.Collection;
import java.util.Map;
import java.util.Set;

/**
 * @author Vilyuzhanin Denis (Fin)
 */
public interface BoxNet {

    SignalId createInputSignal();

    SignalId createSignal();

    void markAsOutput(SignalId signalId);

    Set<SignalId> getInputSignals();

    Set<SignalId> getOutputSignals();

    boolean isInputSignal(SignalId signalId);

    boolean isOutputSignal(SignalId signalId);

    Set<SignalId> getDestinationSignals(SignalId sourceId);

    <Data> Map<SignalId, Data> getSignalsData(SignalId signalId);

    <Data> void connect(SignalId source, SignalId destination, Data data);

    void disconnect(SignalId source, SignalId destination);

    boolean isConnected(SignalId source, SignalId destination);

    void setTrigger(SignalId signal, Trigger trigger);

    Trigger getTrigger(SignalId signal);
}
